<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStoresTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stores', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('member_id')->unique();

            $table->boolean('audit_status')->default(false); // 审核状态
            $table->dateTime('audit_end')->nullable(); // 审核通过时间

            $table->string('store_logo')->default(''); // LOGO
            $table->string('store_banner')->default(''); // Banner

            $table->integer('area_province')->default(0); // 省份 ID
            $table->integer('area_city')->default(0); // 城市 ID
            $table->integer('area_country')->default(0); // 地区 ID

            $table->string('address')->default(''); // 详细地址
            $table->string('contact_phone')->default(''); // 联系电话
            $table->string('contact_qq')->default(''); // 联系 QQ

            $table->integer('tax_registration')->unsigned();  // 税务登记证
            $table->integer('organization_code_cert')->unsigned(); // 组织机构代码证

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('stores');
    }
}
